package com.linwen.excise.niuke._60;

import java.util.Scanner;

/**
 * @author wlw
 * @date 2023/3/16 11:36 PM
 */
public class _51输出单向链表中倒数第k个结点 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        MyNode root = new MyNode();
        MyNode temp = root;
        for (int i = 0; i < n; i++) {
            MyNode myNode = new MyNode();
            myNode.key = scanner.nextInt();
            temp.nextNode = myNode;
            temp = myNode;
        }
        int k = scanner.nextInt();
        MyNode fast = root;
        MyNode slow = root;
        for (int i = 0; i < k; i++) {
            fast = fast.nextNode;
        }
        while (true){
            if(fast==null){
                break;
            }
            fast = fast.nextNode;
            slow = slow.nextNode;
        }
        System.out.println(slow.key);
    }
    static class MyNode{
        int key;
        MyNode nextNode;
    }
}


